﻿<%@ taglib prefix="page" uri="http://com.qipay/pagelib" %>
<%@ page language="java" import="com.qipay.admin.utils.SiteHelper" contentType="text/html;charset=utf-8" %>

<%@ page import="com.qipay.baas.model.MiBeiConstants" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="com.qipay.baas.model.YuXiuConstants" %>
<%@ page import="com.qipay.admin.spyuxiumch.SpYuXiuBalanceVo" %>
<%@ page import="com.qipay.baas.model.SpYuxiuWidthdraw" %>
<!doctype html>
<html>
<head>
    <jsp:include page="head.jsp"></jsp:include>
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <jsp:include page="nav.jsp"></jsp:include>
    <jsp:include page="left.jsp"></jsp:include>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Main content -->
        <% SpYuxiuWidthdraw spYuxiuWidthdraw = (SpYuxiuWidthdraw) request.getAttribute("detail");
            boolean isAdd = String.valueOf(request.getAttribute("isadd")).equals("1");
            SpYuXiuBalanceVo balanceVo = (SpYuXiuBalanceVo) request.getAttribute("balanceVo");

        %>
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box box-info">

                        <div class="box-header with-border">
                            <h3 class="box-title">编辑提现商户</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form class="form-horizontal" action="save" method="POST" id="doc-vld-msg">
                            <input type="hidden" name="isApply">
                            <input type="hidden" name="id"
                                   value="<%= isAdd?"":String.valueOf(spYuxiuWidthdraw.getId())%>">
                            <div class="box-body" id="dvContent">

                                <div class="form-group">
                                    <label for="txtd0" class="col-sm-2 control-label">D0余额：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtd0"
                                               value="<%=balanceVo.getD_AMT()!=null?balanceVo.getD_AMT():"" %>"
                                               placeholder="D0余额">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtT1" class="col-sm-2 control-label">T1余额：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtT1"
                                               value="<%=balanceVo.getT_AMT()!=null?balanceVo.getT_AMT():"" %>"
                                               placeholder="T1余额">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtfrzbal" class="col-sm-2 control-label">未结算余额：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtfrzbal"
                                               value="<%=balanceVo.getFRZ_BAL()!=null?balanceVo.getFRZ_BAL():"" %>"
                                               placeholder="D0余额">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="txttrdecode" class="col-sm-2 control-label">交易码：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txttrdecode"
                                               name="operator" mush="1"
                                               value="<%= YuXiuConstants.TRDE_CODE_VALUE %>" placeholder="交易码">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtprtcode" class="col-sm-2 control-label">机构号：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtprtcode"
                                               name="prtCode" mush="1"
                                               value="<%= YuXiuConstants.PRT_CODE_VALUE %>" placeholder="机构号">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtverno" class="col-sm-2 control-label">版本号：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtverno"
                                               name="operator" mush="1"
                                               value="<%= YuXiuConstants.VER_NO_VALUE %>" placeholder="版本号">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtmerchid" class="col-sm-2 control-label">商户号：</label>
                                    <div class="col-sm-10">
                                        <input readonly="true " type="text" class="form-control" id="txtmerchid"
                                               name="mchId" mush="1"
                                               value="<%= YuXiuConstants.MERC_ID_VALUE %>" placeholder="商户号">
                                    </div>
                                </div>


                                <%--  //单位元--%>

                                <div class="form-group">
                                    <label for="txtwithdrawmoney" class="col-sm-2 control-label">代付金额/元：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtwithdrawmoney"
                                               name="withdrawMoney"
                                               mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getWithdrawMoney()/100 %>"
                                               placeholder="代付金额,只能为整数,单笔最小不低于 1 元">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtpersonNm" class="col-sm-2 control-label">收款人姓名：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtpersonNm"
                                               name="personNm"
                                               mush="1" value="<%= isAdd?"":spYuxiuWidthdraw.getPersonNm()%>"
                                               placeholder="收款人姓名">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="txtCardNo" class="col-sm-2 control-label">收款人卡号：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtCardNo"
                                               name="cardNo" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getCardNo()%>"
                                               placeholder="收款人卡号">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtbnknm" class="col-sm-2 control-label">开户支行名称：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtbnknm"
                                               name="bnkNm" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getBnkNm()%>"
                                               placeholder="开户支行名称">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtbnkno" class="col-sm-2 control-label">银行代码：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtbnkno"
                                               name="bnkNo" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getBnkNm()%>"
                                               placeholder="银行代码">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtbnkCd" class="col-sm-2 control-label">联行号：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtbnkCd"
                                               name="bnkCd" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getBnkCd()%>"
                                               placeholder="联行号">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtcrpIdNo" class="col-sm-2 control-label">收款人身份证：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtcrpIdNo"
                                               name="crpIdNo" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getCrpIdNo()%>"
                                               placeholder="收款人身份证">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="txtphoneNo" class="col-sm-2 control-label">收款人手机号：</label>
                                    <div class="col-sm-10">
                                        <input type="text" class="form-control" id="txtphoneNo"
                                               name="phoneNo" mush="1"
                                               value="<%= isAdd?"":spYuxiuWidthdraw.getPhoneNo()%>"
                                               placeholder="收款人手机号">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="ddlpayId" class="col-sm-2 control-label">代付类型：</label>
                                    <div class="col-sm-10">
                                        <select id="ddlpayId" name="payId">
                                            <option value="D0"><%= SiteHelper.getYuXiuPayId((byte) 0)%>
                                            </option>
                                            <option value="T1"><%= SiteHelper.getYuXiuPayId((byte) 1)%>
                                            </option>
                                        </select>
                                    </div>
                                </div>
                            </div>


                            <!-- /.box-body -->
                            <div class="box-footer">
                                <button type="button" class="btn btn-default" onclick="window.history.back()">返回
                                </button>
                                <%if (spYuxiuWidthdraw == null || (spYuxiuWidthdraw != null && spYuxiuWidthdraw.getState() != null && spYuxiuWidthdraw.getState() != 0)) {%>

                                <button type="button"
                                        class="button back-gray pull-right" id="btnSave">代付
                                </button>
                                <%}%>
                            </div>
                            <!-- /.box-footer -->

                        </form>
                    </div>
                    <!-- /.box -->
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
        </section>
        <!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <jsp:include page="foot.jsp"></jsp:include>
</div>
<script type="text/javascript"
<script src="<%= request.getAttribute("StaticHost") %>/js/fastclick.js"></script>
<script src="<%= request.getAttribute("StaticHost") %>/js/adminlte.min.js"></script>
<script>
    $(function () {
        /*申请时判断必填项*/
        $("#btnSave").on("click", function () {
            var isGo = checkInputMust("dvContent");
            var fee = $("#txtwithdrawmoney").val();
            var r = /^\+?[1-9][0-9]*$/;　　//正整数
            isGo=r.test(fee);
            if(fee<1||isGo==false){
                alert("代付金额为大于1元的整数")
            }
            if (isGo) {
                $("#doc-vld-msg")[0].submit();
            }
        })
    })


</script>
</body>
</html>

